<template>
    <div>
        <button  @click="sendcode">获取验证码</button>
        <input type="text" v-model="captcha">
        <button @click="Check">提交</button>
    </div>
</template>
<script>
export default {
    name:'Verification Code',
    data(){
        return {
            captcha:''
        }
    },
    methods:{
         //发送验证码
        sendcode(){
        let o={
            phone:18435139060
        }
        this.$api.Verification(o).then(res=>{
            console.log('已发送')
        }).catch(()=>{})
        },
    // 验证是否成功
        Check(){
        let o={
            phone:18435139060,
            captcha:this.captcha
        }
        this.$api.Check(o).then(res=>{
            console.log('right')
        }).catch(()=>{console.log('error')})
        },
    }
}
</script>
<style scoped>

</style>